<?php

App::uses('AppModel', 'Model');

class Tax extends AppModel {
    
    public function getForDate($date=null) {
    	$date = $date ? $date : date('y-m-d');
        $value = $this->find('first', array(
            'conditions' => array( 'Tax.effective_date <=' => $date),
            'order'      => 'Tax.effective_date DESC',
            'fields'     => 'Tax.value'
        ));
        return $value['Tax']['value'];
    }
    
}

?>